/**
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../../styles/variables';

.header {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  grid-template-rows: 1fr;
  row-gap: 8px;
  align-items: center;
  width: 100%;
  padding: 16px;
  z-index: 2;

  @media screen and (min-width: $desktop) {
    padding: 40px 40px 16px 40px;
    grid-template-columns: 1fr minmax(1fr, 540px) 1fr;
    column-gap: 24px;
    row-gap: 0px;
    align-items: center;
  }

  &:global(.extended) {
    grid-template-rows: 1fr max-content;
  }

  .logo {
    grid-column: 1 / span 1;
    font-size: 24px;
    line-height: 36px;
    font-weight: 500;
    color: $orange;
  }

  .statusBar {
    grid-column: 1 / span 3;
    grid-row: 2 / span 1;
    height: 24px;
    transition: 400ms ease;
    opacity: 1;

    &.hide {
      opacity: 0;
    }
  }

  .settings {
    grid-column: 3 / span 1;
    height: 40px;
    transition: 400ms ease;
    opacity: 1;

    &.hide {
      opacity: 0;
    }
  }

  @media screen and (max-width: $desktop) {
    transition: margin-top 0.3s ease-in-out;

    &.inputActive {
      margin-top: -50px;
    }
  }

  @media screen and (min-width: $desktop) {
    .statusBar {
      width: 100%;
      max-width: 538px;
      margin-top: 0px;
      grid-column: 2 / span 1;
      grid-row: 1 / span 1;
      justify-self: center;
    }

    .settings {
      justify-self: end;
    }
  }

  .closeBtn {
    position: absolute;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 100px;
    background: $orange;
    margin-left: auto;
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 400ms ease;
    opacity: 0;
    pointer-events: none;

    span {
      color: $white;
      font-size: 24px;
    }

    &.show {
      pointer-events: initial;
      transition-delay: 400ms;
      opacity: 1;
    }

    @media screen and (min-width: $desktop) {
      right: 40px;
    }
  }
}
